package com.csdj.rest.config;

import com.csdj.middleware.MqttMsgHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MqttConsumerConfig {

    private Logger log = LoggerFactory.getLogger("mqtt");

    @Bean
    public MqttMsgHandler mqttMsgHandler(){
        return new MqttMsgHandler() {
            @Override
            public void onMessage(String topic, String msg) {
                log.info("topic:{}  msg:{}",topic,msg);
            }
        };
    }
}
